import os, sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from lstack import LinkStack

def Reverse(st):
    tmp = []
    while not st.empty():
        tmp.append(st.pop())
    for num in tmp:
        st.push(num)


if __name__ == "__main__":
    st = LinkStack()
    numl = [1, 2, 3, 4]
    for num in numl:
        st.push(num)
    Reverse(st)
    while not st.empty():
        print(st.pop())